package com.xmh.test.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;

public class SexVideoEntity implements Serializable {

	/**
	 * 版本号
	 */
	private static final long serialVersionUID = 416374403203555925L;

	/**
	 *
	 */
	private Integer id;

	/**
	 *
	 */
	private String title;

	/**
	 *
	 */
	private String path;

	/**
	 *
	 */
	private Boolean state;

	/**
	 *
	 */
	private String url;

	private String cover;

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	/**
	 *
	 */
	private Integer downid;

	/**
	 *
	 */
	private Date createDate;

	/**
	 *
	 */
	private Date updateDate;

	@SuppressWarnings("unchecked")
	public SexVideoEntity(String json) {
		this(JSONObject.parseObject(json, Map.class));
	}

	public SexVideoEntity() {
	}

	public SexVideoEntity(Map<String, Object> map) {
		if (map == null || map.isEmpty()) {
			return;
		}

		if (map.get("id") != null) {
			id = Integer.valueOf(String.valueOf(map.get("id")));
		}

		title = (String) map.get("title");

		path = (String) map.get("path");

		if (map.get("state") != null) {
			state = Boolean.valueOf(String.valueOf(map.get("state")));
		}

		url = (String) map.get("url");

		if (map.get("downid") != null) {
			downid = Integer.valueOf(String.valueOf(map.get("downid")));
		}

		Object createDateobj = map.get("createDate");
		if (createDateobj != null) {
			if (createDateobj instanceof Date) {
				createDate = (Date) createDateobj;
			} else {
				createDate = new Date((long) createDateobj);
			}
		}

		Object updateDateobj = map.get("updateDate");
		if (updateDateobj != null) {
			if (updateDateobj instanceof Date) {
				updateDate = (Date) updateDateobj;
			} else {
				updateDate = new Date((long) updateDateobj);
			}
		}

	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Boolean getState() {
		return state;
	}

	public void setState(Boolean state) {
		this.state = state;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getDownid() {
		return downid;
	}

	public void setDownid(Integer downid) {
		this.downid = downid;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	@Override
	public String toString() {
		return "SexVideoEntity [id=" + id + ", title=" + title + ", path=" + path + ", state=" + state + ", url=" + url
				+ ", downid=" + downid + ", createDate=" + createDate + ", updateDate=" + updateDate + "]";
	}

	public SexVideoEntity(Integer downid) {
		this.downid = downid;
	}

}